using System.Linq;
using System.Threading.Tasks;
using Avalonia.Collections;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;

namespace NewUI.ViewModels;

partial class LoginViewModel : ViewModelBase
{
    [ObservableProperty] private bool _isBusy;
    [ObservableProperty] private bool _isLoggingIn;
    [ObservableProperty] private string _password;
    [ObservableProperty] private string _passwordConfirm;
    [ObservableProperty] private string _username;
    [ObservableProperty] private string _selectedLanguageContent;
    public AvaloniaList<string> LanguageContent { get; } = [];

    public LoginViewModel()
    {
        LanguageContent = new()
        {
           "中文",
           "英文"
        };
        SelectedLanguageContent = LanguageContent.FirstOrDefault();
    }

    [RelayCommand]
    private Task Login()
    {
        return Task.CompletedTask;
    }
}